//
//  BGHeaderView.m
//  商城
//
//  Created by runone02 on 2018/11/5.
//  Copyright © 2018年 liqiyun. All rights reserved.
//

#import "BGHeaderView.h"

@implementation BGHeaderView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI {
    self.showLabel = [[UILabel alloc]init];
    self.showLabel.font = TITLE_FONT(30);
    self.showLabel.textColor = [UIColor lightGrayColor];
    self.showLabel.textAlignment = NSTextAlignmentLeft;
    self.showLabel.text = @"让购物更便捷";
    [self addSubview:self.showLabel];
    [self.showLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self);
        make.centerY.mas_equalTo(self).with.offset(-W_RATIO(20));
    }];
    
    self.prompt = [[UILabel alloc]init];
    self.prompt.font = TITLE_FONT(28);
    self.prompt.textColor = [UIColor lightGrayColor];
    self.prompt.textAlignment = NSTextAlignmentLeft;
    self.prompt.text = @"下拉刷新";
    [self addSubview:self.prompt];
    [self.prompt mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self);
        make.top.mas_equalTo(self.showLabel.mas_bottom).with.offset(W_RATIO(10));
    }];
    
    self.icon = [[UIImageView alloc]init];
    self.icon.image = IMAGE(@"deliveryStaff1");
    [self addSubview:self.icon];
    [self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.showLabel.mas_left).with.offset(-W_RATIO(50));
        make.top.mas_equalTo(self).with.offset(W_RATIO(20));
        make.bottom.mas_equalTo(self).with.offset(-W_RATIO(20));
        make.width.mas_equalTo(50);
    }];
}

@end
